define(["jQuery", "kendo"], function ($, kendo) {
    return {
		show : function(){
			$(".imgstamp").each(function(){
				$(this).removeClass('active');
			});
			$( "#stamp-dragable-menu" ).show();
			// App.setEnableKineticCreationMode(true);			
		},
		
        init: function (e) {
			$("#stamp-dragable-menu").draggable();
			$("#stamp-dragable-menu").hide();
		
			
			$(".stamp-tools").click(function() {
				if(App.isModeArea != 1){
					alert(App.localize("%view_mode_warning_dialog"));
					return;
				}
				if(!App.toolboxValidation("tool_stamp_ico"))
				{
					return;
				}
				// $("#stamp-dragable-menu").offset({top:$(this).offset().top,left:$(this).offset().left});
				App.stampToolbox.show();
				$(this).addClass('active');
				App.openedTool = $(this);
			});
			
			$(".creation-stamp").click(function() {
				$("img").removeClass('active');
				var idStamp = $(this).parent().find(">:first-child").attr("id");
				var imgStamp = $("#"+idStamp).find(">:first-child").attr("id");
				// console.log(imgStamp);
				$("#"+imgStamp).addClass('active');
				var stampPath = $(this).attr('stamp-path');
				App.setEnableStampCreationMode(true,stampPath);
			});		
			
			$(".cancel-stamp-button").live('click',function() {
				App.openedTool.removeClass('active');
				App.openedTool=false;
				$( "#stamp-dragable-menu" ).hide();
				App.setEnableStampCreationMode(false,"");
				// App.setEnableKineticCreationMode(false);
			});
		
		}
	}
});